//
//  YCNavigationViewController.m
//  YCSchool
//
//  Created by yanglinxia on 16/4/26.
//  Copyright © 2016年 yanglinxia. All rights reserved.
//

#import "YCNavigationViewController.h"
#import "YCSignUpMapViewController.h"

@interface YCNavigationViewController ()

@end

@implementation YCNavigationViewController

+ (void)initialize
{
    UINavigationBar *bar = [UINavigationBar appearance];
    bar.backgroundColor = [UIColor whiteColor];
    //导航栏
    [bar setTintColor:[UIColor blackColor]];
    [bar setShadowImage:[UIImage yc_imageWithColor:[UIColor clearColor] size:CGSizeMake(kScreenWidth, 1)]];
    [bar setBackgroundImage:[UIImage yc_imageWithColor:[UIColor whiteColor] size:CGSizeMake(kScreenWidth, 64)] forBarMetrics:UIBarMetricsDefault];
    [bar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]}];
}

- (void)setNavigationBarClearColor
{
    UINavigationBar *bar = self.navigationBar;
    [bar setTintColor:[UIColor clearColor]];
    bar.backgroundColor = [UIColor clearColor];
    [bar setShadowImage:[[UIImage alloc] init]];
    [bar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
}

- (void)setNavigationBarResume
{
    UINavigationBar *bar = self.navigationBar;
    [bar setTintColor:[UIColor blackColor]];
    bar.backgroundColor = [UIColor whiteColor];
    [bar setShadowImage:[UIImage yc_imageWithColor:[UIColor clearColor] size:CGSizeMake(kScreenWidth, 1)]];
    [bar setBackgroundImage:[UIImage yc_imageWithColor:[UIColor whiteColor] size:CGSizeMake(kScreenWidth, 64)] forBarMetrics:UIBarMetricsDefault];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    //侧滑手势代理设置
//    self.interactivePopGestureRecognizer.delegate = self;
    
}

//- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
//{
//    if (self.childViewControllers.count >= 1) {//非第一个子控制器时,返回都是一样的
//        
//        //隐藏底部tabBar
//        viewController.hidesBottomBarWhenPushed = YES;
//        
//        //统一设置返回
//        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem backItemWithImage:@"nav_back" highlightImage:@"nav_back" target:self action:@selector(back) title:@""];
//        
//    }
//    
//    [super pushViewController:viewController animated:animated];
//    
//}


//- (void)back
//{
//    [self popViewControllerAnimated:YES];
//}
//
////每当用户触发[返回手势]时都会调用一次这个方法
////侧滑手势处理,如果只有一个子控制器时,则不响应手势.
//- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
//{
//    return self.childViewControllers.count > 1;
//    
//}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
